import Vue from 'vue'
import Vuex from 'vuex'
import { getStorage, setStorage, removeStorage } from '@/utils/storage'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    user: getStorage('tt')
  },
  mutations: {
    inituser (state, data) {
      state.user = data
      setStorage('tt', data)
    },
    removeuser (state) {
      state.user = null
      removeStorage('tt')
    }
  },
  actions: {
  },
  modules: {
  }
})
